<template>
        <h1>子组件:{{ num }}</h1>
</template>
<script setup>
    import {ref } from 'vue'
    let num = ref(0)
    const getNum = ()=>{
        console.log(num.value++);
    }
    // 抛出数据
    defineExpose({
        num,getNum
    })
</script>
<style>
.box {
    min-height: 200px;
    border: 1px solid #000;
    padding: 20px;
    box-sizing: border-box;
}
</style>